<!DOCTYPE html>
<html lang="en">
<head>
<title>魔狗微博</title>
<link href="/static/index/css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all" /><!-- fontawesome -->
<link href="/static/index/css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" /><!-- Bootstrap stylesheet -->
<link href="/static/index/css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- stylesheet -->
<!-- meta tags -->
	<link rel="stylesheet" type="text/css" href="/static/index/css/jquery.sinaEmotion.css" />

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //meta tags -->
<!--fonts-->
<link href="http://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="/static/index/css/toastr.min.css" />
<!--//fonts-->
<script type="text/javascript" src="/static/index/js/jquery-2.1.4.min.js"></script>
<script src="/static/index/js/main.js"></script>
	<!--<script type="text/javascript" src="/static/index/js/jquery-1.8.0.min.js"></script>-->

	<script type="text/javascript" src="/static/index/js/jquery.sinaEmotion.js"></script>
<!-- Required-js -->
<!-- start-smoth-scrolling -->
<script type="text/javascript" src="/static/index/js/move-top.js"></script>
<script type="text/javascript" src="/static/index/js/easing.js"></script>

<script type="text/javascript">
	jQuery(document).ready(function($) {
		$(".scroll").click(function(event){		
			event.preventDefault();
			$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
		});


	});



</script>
<!-- start-smoth-scrolling -->

<!-- scriptfor smooth drop down-nav -->
<script>
$(document).ready(function(){
    $(".dropdown").hover(            
        function() {
            $('.dropdown-menu', this).stop( true, true ).slideDown("fast");
            $(this).toggleClass('open');        
        },
        function() {
            $('.dropdown-menu', this).stop( true, true ).slideUp("fast");
            $(this).toggleClass('open');       
        }
    );



});



</script>
<!-- //script for smooth drop down-nav -->
</head>
<body>
<!-- header -->
<nav class="navbar  navbar-fixed-top" role="navigation" style="background: #e0620d ;padding-top: 3px;height:50px;">
	<div class="container-fluid" style="background: #fff;">
		<div class="navbar-header ">

			<a class="navbar-brand " href="{:url('/index/index/index')}">返回首页</a>


			<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target="#my-navbar-collapse">
				<span class="sr-only">切换导航</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
		</div>
		<form class="navbar-form navbar-left" role="search" action="{:url('/wbSearch')}" method="post">
			<div class="form-group">
				<input type="text" class="form-control" name="Search" placeholder="微博找人">
				<button class="glyphicon glyphicon-search btn_search btn btn-default"></button>
				<!--  <button type="submit" class="btn btn-default">提交</button> -->
			</div>

		</form>

		<div class="collapse navbar-collapse" id="my-navbar-collapse">

			<ul class="nav navbar-nav navbar-right">

				<li><img src="{$photo}" width="30px" style="border-radius: 50%">

					<!--判断为普通还是企业用户-->
					<?php if ($role == 1) { ?>
					<a href="{:url('index/cuser/index')}" style="color: black;padding: 0px!important;" class="mingzi">{$username}</a>
					<?php }else{ ?>
					<a href="{:url('index/buser/index')}" style="color: black;padding: 0px!important;" class="mingzi">{$username}</a>
					<?php } ?>
					<!--//判断为普通还是企业用户-->
				</li>

				<li class="dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown">
						安全中心<b class="caret"></b>
					</a>
					<ul class="dropdown-menu">
						<a href="{:url('index/login/loginOut')}" class="roll-nav roll-right J_tabExit tuichu">

							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <i
								class="fa fa fa-sign-out"></i>
							退出</a><br>

						<a href="{:url('/editpass')}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;更改密码</a>

					</ul>


				</li>
			</ul>
		</div>
	</div>
	<hr style="margin: 0;padding: 0;color:#222;width: 100%">
</nav>




	<header>
		<hr>
		<hr>
		<div class="w3layouts-top-strip">
			<div class="container">
				<div class="logo">
					<h1><a href="{:url('index/index')}">魔狗微博</a></h1>
				</div>
				<div class="w3ls-social-icons">
					<a class="facebook" href="https://www.baidu.com/link?url=e1Kcw7K2wM6Xo5CiRVyywYCL5UPtMdCDoHDqAb9mGSy&wd=&eqid=e82fd8100004f00b000000035c74c9e5" target="_blank"><i class="fa fa-facebook"></i></a>
					<a class="twitter" href="https://www.baidu.com/link?url=Rs1nYP_M_X_GuCtGROFaIQ2SxccwzuzoT4qpFCTj2ty&ck=3078.5.32.152.288.345.176.238&shh=www.baidu.com&sht=02003390_29_hao_pg&wd=&eqid=fdba12e40004b6b1000000035c74c9fa" target="_blank"><i class="fa fa-twitter"></i></a>
					<a class="pinterest" href="https://www.baidu.com/link?url=Ec_RhU7gkkAc7_SmOQu_zOoGqZmltSSAVcnLKZf3lGX71xN1xHk0jN-BHpX9FXAG&wd=&eqid=9077fca200049296000000035c74ca0a" target="_blank"><i class="fa fa-pinterest-p"></i></a>
					<a class="linkedin" href="https://www.linkedin.com/?trk=brandpage_baidu_pc-mainlink" target="_blank"><i class="fa fa-linkedin"></i></a>
				</div>
			</div>
		</div>
		<!-- navigation -->
			<nav class="navbar navbar-default">
			  <div class="container">
				<!-- Brand and toggle get grouped for better mobile display -->
				<div class="navbar-header">
				  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				  </button>
				</div>

				<!-- Collect the nav links, forms, and other content for toggling -->

				<div class="w3_agile_login">
							<div class="cd-main-header">
								<a class="cd-search-trigger" href="#cd-search"> <span></span></a>
								<!-- cd-header-buttons -->
							</div>
							<div id="cd-search" class="cd-search">
								<form action="#" method="post">
									<input name="Search" type="search" placeholder="Search...">
								</form>
							</div>
						</div>
						<div class="clearfix"> </div>

			  </div><!-- /.container-fluid -->
			</nav>
			
		<!-- //navigation -->
	</header>
	<!-- //header -->
	<!-- banner -->
	<div class="agile-banner">
	</div>
	<!-- //banner -->
	<!-- breadcrumbs -->
	<div class="breadcrumbs">
		<div class="container">
			<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
				<li><a href="{:url('index/index')}">魔狗微博</a></li>
				<li class="active">详情</li>
			</ol>
		</div>
	</div>
<!-- //breadcrumbs -->
	<div class="container">
		<div class="banner-btm-agile">
		<!-- //btm-wthree-left -->
			<div class="col-md-2"></div>
			<div class="col-md-9 btm-wthree-left">
				<div class="single-left">
				<div class="single-left1">
					<?php if ($path) { ?>
					<img src="{$path['path']}" width="300px" height="300px"/>
					<?php }else{ ?>

					<?php } ?>




					<ul>
						<li><span class="glyphicon glyphicon-user" aria-hidden="true"> &nbsp; {$data['username']}</span></li>
							<li ><span class="fa fa-thumbs-up agree-btn" aria-hidden="true" data-id="{$data['id']}"> &nbsp; {$data['agreenum']}</span></li>
						<li ><span class="fa fa-share turn-btn" aria-hidden="true" data-toggle="modal" data-target="#exampleModal" data-id="{$data['id']}"> &nbsp; {$data['transpondnum']}</span></li>
					</ul>
					<p>{:replace_weibo($data['content'])}</p>
				</div>


				<div class="comments">
					<h3>评论:</h3>
					{volist name='res' id='re'}
					{empty name= "re['rid']"}
					<div class="comments-grids">
						<div class="comments-grid">
							<div class="comments-grid-left">
								<img src="{$re['photo']}" alt=" " class="img-responsive" />
							</div>
							<div class="comments-grid-right">
								<h4><a href="#">{$re['username']}</a></h4>
								<ul>
									<li>{$re['time']} <i>|</i></li>
									<li><a href="" class="replay" data-toggle="modal" data-target="#exampleModal" con-id="{$re['cid']}" data-id="{$data['id']}" user-id="{$re['uid']}">回复</a></li>
								</ul>
								<p>{:replace_weibo($re['content'])}</p>
							</div>
							<div class="clearfix"> </div>
						</div>
					</div>
					{else /}
					<div class="comments-grids">
						<div class="comments-grid">
							<div class="comments-grid-left">
								<img src="{$re['photo']}" alt=" " class="img-responsive" />
							</div>
							<div class="comments-grid-right">
								<h4><a href="">{$re['username']}  </a><b>回复</b><a href="">{$re['oldname']['username']}</a></h4>
								<ul>
									<li>{$re['time']} <i>|</i></li>
									<li><a href="" class="replay" data-toggle="modal" data-target="#exampleModal" con-id="{$re['cid']}" data-id="{$data['id']}" user-id="{$re['uid']}">回复</a></li>
								</ul>
								<p>{:replace_weibo($re['content'])}</p>
							</div>
							<div class="clearfix"> </div>
						</div>
					</div>
					{/empty}
					{/volist}
				</div>
				<div class="leave-coment-form">
					<h3>发表你的意见:</h3>
					<form action="{:url('index/content/content')}" method="post">
						<input type="hidden" name="mid" value="{$data['id']}">
						<textarea name="content" placeholder="这儿呢这儿呢" required=""></textarea>
						<!--<i class="fa fa-smile-o face"></i>-->

						<div class="w3_single_submit">
							<input type="submit" value="发表评论" >
						</div>
					</form>
				</div>
			</div>
			</div>
		</div>
	</div>



<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="exampleModalLabel">转发</h4>
			</div>
			<div class="modal-body">
				<form>
					<div class="form-group">
						<label for="recipient-name" class="control-label con-old">原微博</label>
						<div class="username"></div>
						<div class="form-control old" id="message-text" style="border: solid #ccc 1px;height: 50px;"></div>
						<input type="text" name="mid" value="" class="mid" hidden>
						<input type="text" name="cid" value="" class="cid" hidden>
						<input type="text" name="uid" value="" class="uid" hidden>

					</div>
					<div class="form-group">
						<label for="message-text" class="control-label con-new">你的意见</label>
						<textarea class="form-control new" id="message-text"></textarea>
					</div>
				</form>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default clos" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary turn">转发</button>
				<button type="button" class="btn btn-primary commen" style="display: none">回复</button>

			</div>
		</div>
	</div>
</div>
	<!-- //btm-wthree-left -->
				<!-- btm-wthree-right -->
<script src="/static/index/js/toastr.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			/*
				var defaults = {
				containerID: 'toTop', // fading element id
				containerHoverID: 'toTopHover', // fading element hover id
				scrollSpeed: 1200,
				easingType: 'linear'
				};
			*/

			$().UItoTop({ easingType: 'easeOutQuart' });

			});

		$('.jump').click(function () {
			var name = $(this).attr('data-name');
			// var name = 1111;
			console.log("{:url('/index/talk/name')}?name='"+name+"'");
			window.location.href="{:url('/index/talk/name')}?name='"+name+"'";
		});



		toastr.options = {
			closeButton: true,// 是否显示关闭按钮
			progressBar: true,// 实现显示计时条
			timeOut: "1000",  // 自动关闭时间
			positionClass: "toast-bottom-left" // 提示位置
			// toast-top-full-width 顶端，宽度铺满整个屏幕
			// toast-top-right  顶端右边
		};

		$(function () {
			// 触发点赞操作
			$('.agree-btn').click(function () {
				var mid = $(this).attr('data-id');
				// $(this).text('11111');
				res = $(this);

				$.ajax({
					type: 'get',
					url: "/index/send/agree/"+mid,
					dataType: 'json',
					success: function (data) {
						// console.log(data);
						if (data[0]) {
							toastr.success('已赞');
							// console.log(res);
							res.html(  ' &nbsp; '+ data[1]);
						} else {
							toastr.error('最多只能赞一次哦', '不好意思哈: ');
						}
					},
					error: function () {

						toastr.error('AJAX 执行错误!', '警告:');
					}
				});


				//触发转发操作





			});

			$('.turn-btn').click(function () {
				var content = $(this).parent().parent().next().html();
				// console.log(content);
				var username = $(this).parent().prev().prev().children().html();
				// console.log(username);
				var mid =$(this).attr('data-id');
				console.log(mid);
				$('.old').html(content);
				$('.mid').val(mid);
				$('.username').html(username+' : ');
				$('.con-old').html('转发');

				$('.turn').show();
				$('.commen').hide();
				$('#exampleModalLabel').html('转发');
				$('.new').val(' ');

			});
			//点击转发
			$('.turn').click(function () {
				var oldContent = $('.old').val();
				var mid = $('.mid').val();
				var content = $('.new').val();

				$('.clos').click();
				// console.log(oldContent,mid,content);
				//执行ajax
				$.ajax({
					type: 'post',
					url: "/index/send/turn",
					contentType:'application/x-www-form-urlencoded;charset=utf-8',
					data:{src_id:mid,content:content},
					dataType: 'json',
					success: function (data) {
						// console.log(data);
						if (data) {

							toastr.success('转发成功','牛皮!:');
						} else {
							toastr.success('未登录','抱歉!:');
							window.location.href="{:url('login/index')}";
						}
					},
					error: function () {
						toastr.error('AJAX 执行错误!', '警告:');
					}
				});


			});

			//点击回复
			$('.replay').click(function () {
				var content = $(this).parent().parent().next().html();
				// console.log(content);
				var username = $(this).parent().parent().prev().children().html();
				// console.log(username);
				var mid =$(this).attr('data-id');
				var cid = $(this).attr('con-id');
				var uid = $(this).attr('user-id');
				// console.log(cid);
				// console.log(mid);
				$('.old').html(content);
				$('.mid').val(mid);
				$('.cid').val(cid);
				$('.uid').val(uid);
				$('.username').html(username+' : ');
				$('.turn').hide();
				$('.commen').show();
				$('.con-old').html('评论');
				$('.con-new').html('回复');
				$('#exampleModalLabel').html('回复');
				$('.new').val(' ');

			});
			//点击回复
			$('.commen').click(function () {
				var username = $('.username').text();
				// console.log(username);
				var cid = $('.cid').val();
				var mid = $('.mid').val();
				var content = $('.new').val();

				$('.clos').click();
				// console.log(oldContent,mid,content);
				//执行ajax
				$.ajax({
					type: 'post',
					url: "/index/show/replay",
					contentType:'application/x-www-form-urlencoded;charset=utf-8',
					data:{cid:cid,content:content,mid:mid},
					dataType: 'json',
					success: function (data) {
						// console.log(data);
						if (data) {
							toastr.success('已回复','牛皮!:');
							$('.comments').append('<div class="comments-grids">\n' +
									'\t\t\t\t\t\t<div class="comments-grid">\n' +
									'\t\t\t\t\t\t\t<div class="comments-grid-left">\n' +
									'\t\t\t\t\t\t\t\t<img src="'+data.photo+'" alt=" " class="img-responsive" />\n' +
									'\t\t\t\t\t\t\t</div>\n' +
									'\t\t\t\t\t\t\t<div class="comments-grid-right">\n' +
									'\t\t\t\t\t\t\t\t<h4><a href="#">'+data.username+'</a> <b> 回复 </b> <a href="#"> '+username+'</a></h4>\n' +
									'\t\t\t\t\t\t\t\t<ul>\n' +
									'\t\t\t\t\t\t\t\t\t<li>'+data.time+' <i>|</i></li>\n' +
									'\t\t\t\t\t\t\t\t\t<li><a href="" class="replay" data-toggle="modal" data-target="#exampleModal" con-id="'+data.cid+'" >回复</a></li>\n' +
									'\t\t\t\t\t\t\t\t</ul>\n' +
									'\t\t\t\t\t\t\t\t<p>'+data.content+'</p>\n' +
									'\t\t\t\t\t\t\t</div>\n' +
									'\t\t\t\t\t\t\t<div class="clearfix"> </div>\n' +
									'\t\t\t\t\t\t</div>\n' +
									'\t\t\t\t\t</div>')

						} else {
							toastr.success('未登录','抱歉!:');
							window.location.href="{:url('login/index')}";
						}
					},
					error: function () {
						toastr.error('AJAX 执行错误!', '警告:');
					}
				});

			});

			//点击评论


		});
	</script>
<!-- //here ends scrolling icon -->

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/static/index/js/bootstrap.js"></script>
</body>
</html>